<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Jsonp</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <style>
        .page li{ display:block; float:left; margin-left:5px; border:1px solid #999; padding:10px; }
        .page li a{ color:#67b168;}
        .active{ background-color:#d0e9c6}
    </style>
</head>
<body>
<div class="container" id="app">
    <h1 align="center">获取所有金额大于10000的标的</h1>
    <p align="right"><i>使用jsonp方式获取数据</i></p>
    <div class="row">
        <div class="col-md-3"><h3>标的名称</h3></div>
        <div class="col-md-3"><h3>借款人</h3></div>
        <div class="col-md-3"><h3>金额</h3></div>
        <div class="col-md-3"><h3>发布时间</h3></div>
    </div>
    <div class="row" v-for="biao in biaos">
        <div class="col-md-3">{{ biao.name }}</div>
        <div class="col-md-3">{{ biao.realname }}</div>
        <div class="col-md-3">{{ biao.account | money}}</div>
        <div class="col-md-3">{{ biao.create_time | moment}}</div>
    </div>
</div>
<script src="/static/vue2.js"></script>
<script src="/static/vue-router.js"></script>
<script src="/static/jquery-1.10.2.min.js"></script>
<script>
    Vue.filter('moment',function(value){
        return new Date(parseInt(value) * 1000).toLocaleString().replace(/\//g, "-");
    })
    Vue.filter('money',function(value){
        console.log(value);
        return Math.round(value);
    })
    var vue = new Vue({
        el:'#app',
        data:{
            biaos:"",
            curPage:1,
            pages:2
        },
        beforeCreate:function(){
            var vm = this;
            $.ajax({
                //url : 'http://mylumen.com/form/json_p?account=5000',
                url : 'http://mylumen.com/form/json_p_response?account=5000',
                type : 'GET',
                dataType : "jsonp",
                jsonp : "callback",
                success : function(data){
                        vm.biaos = data.info;
                }

            })
        }
    });
</script>
</body>
</html>